fix: restore lifecycle preflight workspace layout - #235
Conversation
Co-Authored-By: Codex <noreply@openai.com>
🤖 Codex PR Review✅ Merge allowed: No issues found Review by Codex PR Review bot • PR |
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ec132aa3c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| exit 1 | ||
| fi | ||
| snapshot_target="$snapshot_root/data/output" | ||
| rm -rf -- "$LIFECYCLE_LOCAL_ROOT" "$snapshot_target" |
There was a problem hiding this comment.
Validate lifecycle restore path before deleting
When the caller checkout contains a symlinked data directory or other parent of data/lifecycle_store, this rm -rf resolves through that symlink because only the snapshot checkout is realpath/symlink-validated above. In scheduled/workflow_dispatch runs for such a repo, the restore can delete and then overwrite files outside the workspace; please add the same destination validation for $LIFECYCLE_LOCAL_ROOT before removing or copying into it.
Useful? React with 👍 / 👎.
Purpose
Download the preflight bundle at the workflow workspace root so it can restore both
data/lifecycle_storeand snapshot-pipelineexternal/.../data/outputartifacts.Validation
PYTHONPATH=src python3 -m pytest -q tests/test_reusable_drift_workflow.pyactionlint .github/workflows/reusable-drift-check.ymlgit diff --check